package com.wiki.gds.member.provider.modular.member;


import com.wiki.gds.base.security.common.model.SecurityMember;
import org.springframework.beans.BeanUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("ttt")
public class memberController {

    @RequestMapping("/test1")
    public String test(){
        UserDetails userDetails= (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        System.out.println(userDetails);
        SecurityMember securityMember=new SecurityMember();
        BeanUtils.copyProperties(userDetails,securityMember);
        System.out.println(securityMember);
        return "asdasd";
    }

}
